import json
from database_lib.testdb import TestData
from init_lib.req_json.business_req import *


class Business(object):
    def __init__(self):
        self.service = 'business'

    def init_zhw_business_login_data(self):
        TestData().add(self.service, 'login', 'post', req_json=json.dumps(login()))

    def init_zhw_business_get_ts_message_data(self):
        TestData().add(self.service, 'getTsMessage', 'post', req_json=json.dumps(login()))

    def init_zhw_business_get_sys_msg_data(self):
        TestData().add(self.service, 'getMsgNums', 'get', req_json=json.dumps(get_sys_message_mums()))

    def init_zhw_business_get_bottom_info_data(self):
        TestData().add(self.service, 'getBottomInfo', 'get', req_json=json.dumps(get_bottom_info()))

    def init_zhw_business_get_count_no_read_data(self):
        TestData().add(self.service, 'getCountNoRead', 'get', req_json=json.dumps(get_count_no_read()))

    def main(self):
        for method in dir(self.__class__):
            if method.startswith('init'):
                eval('self.' + method)()
